<%@ page language="java" import="java.util.*,com.hs.auth.model.*,com.hs.auth.*" pageEncoding="utf-8"%>
<%
HsAccount accInfo = (HsAccount)request.getSession().getAttribute(AUTHConstant.USERINSESSION);
HsUserinfo userinfo = accInfo==null?null:accInfo.getUserinfo();
Map authMap = (Map)request.getSession().getAttribute("USERPOWER_"+accInfo.getId());
if(authMap == null)
	authMap = new HashMap();
String authstr = null;
String systemstr = null; 
 //String username = (String)request.getAttribute("username"); 
  System.out.println(authMap);
boolean isadmin = "system".equals(accInfo==null?"":accInfo.getLoginid());
boolean role1 = (authMap.get("DNMS_ROLE01")!=null);
boolean role2 = (authMap.get("DNMS_ROLE02")!=null); 
boolean role3 = (authMap.get("DNMS_ROLE03")!=null);
boolean role4 = (authMap.get("DNMS_ROLE04")!=null); 
System.out.println(role1);
System.out.println(role2);
System.out.println(role3);
System.out.println(role4);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<%@ include file="../include.jsp"%>  
<script language=JavaScript>
  //数据检索
 function dataSearch(){
	<% 
	
	if(role1 || role2 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>search/sindex.do";
		//window.parent.cont.frameElement.src  = "<%=basePath %>search/sindexFrame.do";
	<%}else{%>
	   alert("您没有使用该功能的权限!");
	<%}%>
 }
//系统管理
 function userManage(){ 
	<% 
	if(role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>app/system/systemframe.jsp";
	<%}else{%>
	   alert("只有管理员才有用户管理权限!");
	<%}%> 
 }
 //数据管理
 function dataManage(){ 
 	<%
 
	if(role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>data/dataListFrame.do";
	<%}else{%>
	   alert("您没有使用该功能的权限!");
	<%}%> 
 }
  //趋势分析
 function pictureProduce(){
		window.parent.cont.frameElement.src  = "<%=basePath %>app/statics/staticsframe.jsp";
 }
   //数据加工
 function dataProduce(){
	<%
	 
	if(role3 || role1 || isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>app/produce/dataproframe.jsp";
	<%}else{%>
	   alert("您没有使用该功能的权限!");
	<%}%>
 }
   //数据审核
 function dataAudit(){
	<% 
	if(role4 || role1|| isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>app/produce/auditframe.jsp";
	<%}else{%>
	   alert("您没有使用该功能的权限!");
	<%}%>
 }
 //标准管理
 function standerManage(){ 
	<%
	 
	if(role1|| isadmin){
	%>
		window.parent.cont.frameElement.src  = "<%=basePath %>app/standard/standardframe.jsp";
	<%}else{%>
	   alert("只有管理员才有用户管理权限!");
	<%}%> 
 }
 
</script>
</head>
<body class="menu_bg">
<div class="user">欢迎您：<strong><%=userinfo.getUsername()%></strong></div> 
<div class="menu">
	<h1></h1>
    <a href="javaScript:dataSearch()"><img src="<%=imagePath%>ico_sear.gif" />数据检索</a>
    <a href="javaScript:dataManage()"><img src="<%=imagePath%>ico_mana.gif" />数据管理</a>
    <a href="javaScript:pictureProduce()"><img src="<%=imagePath%>ico_anal.gif" />趋势分析</a>
    <a href="javaScript:dataProduce()" ><img src="<%=imagePath%>ico_process.gif" />数据加工</a>
    <a href="javaScript:dataAudit()" ><img src="<%=imagePath%>ico_verify.gif" />数据审核</a>
    <a href="javaScript:standerManage()" ><img src="<%=imagePath%>ico_stand.gif" />标准管理</a>
    <a href="javaScript:userManage()" ><img src="<%=imagePath%>ico_system.gif" />系统管理</a>
</div>
</body>
</html>
